import request from "./request";

export default {
  // 获取成绩列表
  getScores(params) {
    return request({
      url: "/scores",
      method: "get",
      params,
    });
  },

  // 获取单个成绩信息
  getScore(id) {
    return request({
      url: `/scores/${id}`,
      method: "get",
    });
  },

  // 创建成绩
  createScore(data) {
    return request({
      url: "/scores",
      method: "post",
      data,
    });
  },

  // 更新成绩信息
  updateScore(id, data) {
    return request({
      url: `/scores/${id}`,
      method: "put",
      data,
    });
  },

  // 删除成绩
  deleteScore(id) {
    return request({
      url: `/scores/${id}`,
      method: "delete",
    });
  },

  // 批量导入成绩
  importScores(data) {
    return request({
      url: "/scores/import",
      method: "post",
      data,
    });
  },

  // 导出成绩
  exportScores(params) {
    return request({
      url: "/scores/export",
      method: "get",
      params,
      responseType: "blob",
    });
  },
};
